package trong.gold.soft.com.main;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import trong.gold.soft.com.view.LoadingScreen;

public class mTetrisMidlet extends MIDlet {
	private LoadingScreen loading;
	public mTetrisMidlet() {
		loading = new LoadingScreen(this);
	}

	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
		quit();
	}
	public void quit() throws MIDletStateChangeException{
	     destroyApp(false);
	     notifyDestroyed();
	}
	protected void pauseApp() {
		// TODO Auto-generated method stub
	}
	protected void startApp() throws MIDletStateChangeException {
		Display.getDisplay(this).setCurrent(loading);
	}
    public void switchState(Displayable last, Displayable current) {
        last = null;
        Runtime.getRuntime().gc();
        Display.getDisplay(this).setCurrent(current);
    }
    public void showAlert(Alert alert,Form form){
    	Runtime.getRuntime().gc();
    	Display.getDisplay(this).setCurrent(alert,form);
    }
}
